package com.xintoucloud.gsv.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.xintoucloud.gsv.service.SuperVisionService;

@Controller
public class SuperVisionCountController {
	@Autowired
	private SuperVisionService superVisionService;
	
	@RequestMapping("/toSuperVisionCount")
	public String toSuperVisionCount(Model m) {
		long waitRegister=superVisionService.count(2);
		long waitReply=superVisionService.count(3);
		long waitDutyConfirm=superVisionService.count(4);
		long waitLeaderConfirm=superVisionService.count(5);
		long done=superVisionService.count(7);
		long noReply=superVisionService.count(9);
		long noRegister=superVisionService.count(8);	
		List<Object> countlist=new ArrayList<>();
		countlist.add(0, waitRegister);
		countlist.add(1, waitReply);
		countlist.add(2, waitDutyConfirm);
		countlist.add(3, waitLeaderConfirm);
		countlist.add(4, noRegister);
		countlist.add(5, noReply);
		countlist.add(6, done);
		m.addAttribute("countlist", countlist);
		return "superVisionCount";
	
	}
}
